|
|
|
Here we explicitly use the
pointer this to explicitly dereference the invoking object. Fortunately, the
compiler automatically ``inserts'' these dereferences for class
|
|
members, hence, we really
can use the first definitions of setX() and setY(). However, it sometimes
make sense to know that there is a pointer this available which
|
|
indicates the invoking
object.
|
|
Currently, we need to call
the set methods to initialize a point object. However, we would like to
initialize the point when we define it. We therefore use special
|
|
methods called constructors.
|
|
|